package com.shoppingmall.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

import com.shoppingmall.bean.UserInfoBean;
import com.shoppingmall.bean.UserLoginBean;

/**
 * 用户注册数据访问接口
 * @author LIU
 * @version 1.0 2017-11-10
 */
public interface RegisterDao {

	/**
	 * 插入user_info表
	 * @param userInfo
	 */
	@Insert("insert into user_info (username,realname,sex,birth,idCard,email,address,mobile,user_id) "
			+ "values(#{username},#{realname},#{sex},#{birth},#{idCard},#{email},#{address},#{mobile},#{userLoginBean.userId} )")
	@Options(useGeneratedKeys=true,keyProperty="infoId")
	public void addUserInfo(UserInfoBean userInfo);
	
	
	/**
	 * 插入user_login表
	 * @param userInfo
	 */
	@Insert("insert into user_login (username,password) values(#{username},#{password})")
	@Options(useGeneratedKeys=true,keyProperty="userId")
	public void addUserLogin(UserLoginBean userLogin);
	
}
